package com.thiswhyme.stream.rabbit.consumer1;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.stream.annotation.EnableBinding;
import org.springframework.context.annotation.Bean;

import com.thiswhyme.stream.rabbit.consumer1.channel.InputChannel;
import com.thiswhyme.stream.rabbit.interceptor.BizMessageChannelInterceptor;
import org.springframework.integration.config.GlobalChannelInterceptor;

@EnableBinding({InputChannel.class})
@SpringBootApplication
public class StreamRabbitConsumer1Application {

    @Bean
    @GlobalChannelInterceptor
    public BizMessageChannelInterceptor bizMessageChannelInterceptor() {
        return new BizMessageChannelInterceptor();
    }

    public static void main(String[] args) {
        SpringApplication.run(StreamRabbitConsumer1Application.class, args);
    }

}
